﻿using System;
using System.Collections.Generic;
using System.Text;
using BCMS.Business.DataContract;
using BCMS.Settings;

namespace BCMS.FrontEnd.DataContract
{
    public class CouponBriefUI
    {
        public decimal ParValue { set; get; }
        public string Status { set; get; }
        public string ClaimBy { set; get; }
        public DateTime ClaimDate { set; get; }
        public long Qtty { set; get; }
        public decimal TotalValue { set; get; }

        public CouponBriefUI(){}

        public CouponBriefUI(CouponBrief item)
        {
            this.ParValue = item.ParValue;
            this.Qtty = item.TotalQtty;
            this.TotalValue = item.TotalValue;
            switch (item.Status)
            {
                case (int)CStatus.Normal:
                    this.Status = Params.NORMAL;
                    break;
                case (int)CStatus.Claimed:
                    this.Status = Params.CLAIMED;
                    break;
                case (int)CStatus.Expired:
                    this.Status = Params.EXPIRED;
                    break;
                case (int)CStatus.Disposed:
                    this.Status = Params.DISPOSED;
                    break;
                default:
                    this.Status = string.Empty;
                    break;
            }
            this.ClaimDate = item.ClaimDate;
        }
    }
}
